﻿using System.Configuration;

namespace Jet.VersionIncrementor
{
	/// <summary>
	/// Configuration for the tool
	/// </summary>
	internal class VersionConfigurationSection : ConfigurationSection
	{
		/// <summary>
		/// Determine path to solution to process
		/// </summary>
		[ConfigurationProperty("SolutionPath", IsRequired = true)]
		public string SolutionPath { get { return (string)this["SolutionPath"]; } }
		
		/// <summary>
		/// Determine which version should be assigned for all projects of the solution. Not compatible with IncrementedComponent
		/// </summary>
		[ConfigurationProperty("Version", IsRequired = false)]
		public string Version { get { return (string)this["Version"]; } }
		
		/// <summary>
		/// Detrmine which component of version should be incremented. Not compatible with Version
		/// </summary>
		[ConfigurationProperty("IncrementedComponent", IsRequired = false, DefaultValue = VersionComponent.None)]
		public VersionComponent IncrementedComponent { get { return (VersionComponent)this["IncrementedComponent"]; } }

		/// <summary>
		/// Global variable which assigned to latest varsion.
		/// </summary>
		[ConfigurationProperty("VersionGlobalVariable", IsRequired = false)]
		public string VersionGlobalVariable { get { return (string)this["VersionGlobalVariable"]; } }

        /// <summary>
        /// If this flag is set, project version is returnedprinted to console.
        /// </summary>
        [ConfigurationProperty("RetrieveSolutionVersion", IsRequired = false, DefaultValue = false)]
        public bool RetrieveSolutionVersion { get { return (bool)this["RetrieveSolutionVersion"]; } }
	}
}
